package com.wenzhan.service;

import java.util.Optional;

public class TestDemo3 {
    public static void main(String[] args) {
        String userName= "s";
        /*String huawei = Optional.ofNullable(userName).orElse("Huawei");
        System.out.println(huawei);*/
        Optional.ofNullable(userName).ifPresent(s -> System.out.println(s+"第一次"));
    }
}
